package com.study.d7_otherstream;

import java.io.*;

public class TransDemo2 {
    public static void main(String[] args) {
        //可以控制写出去的字符使用什么字符集编码
        try (OutputStream os = new FileOutputStream("day10/src/dlei7.txt");
             Writer wr = new OutputStreamWriter(os,"GBK");
             BufferedWriter bw = new BufferedWriter(wr);
        ){
            bw.write("莫道桑榆晚");
            bw.newLine();
            bw.write("为霞尚满天");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
